{strip}

{literal}
<script>

$(document).ready(function() { 
	var options = { 
        beforeSubmit:  showRequest,  // pre-submit callback 
        success:       showResponse  // post-submit callback 
    }; 
 
    // bind to the form's submit event 
    $('#translation_add_form').submit(function() { 
    	//fakeSubmit.UpdateEditorFormValue();
        $(this).ajaxSubmit(options); 
 
        // !!! Important !!! 
        // always return false to prevent standard browser submit and page navigation 
        //checkForm();
        return false;
    }); 
});

// pre-submit callback 
function showRequest(formData, jqForm, options) { 
    var queryString = $.param(formData); 
    //return checkForm(); 
} 
 
// post-submit callback 
function showResponse(responseText, statusText)  { 
	scroll(0,0);
	//showPopup2(responseText, 'New default phrase', false);
	getLangTranslations({/literal}{$languagesId}{literal});
	//closePopup();
}
</script>
{/literal}

<div style="width: 98%">
	<form id="translation_add_form" method="POST" action="/locale/save-translation" onsubmit="">
	
	<fieldset>
	<legend>Fill the form</legend>
	
		<div class="tLeft"><strong>DEFAULT PHRASE</strong></div>
		<div class="tRight"><strong>TRANSLATION PHRASE</strong></div>
		<div class="clear"> </div>
	<br />
	{foreach $sTranslation as $t}
		<div class="tLeft">{$t.translation}</div>
		<div class="tRight">
				<textarea rows="2" name="addForm[translations][{$t@index}][phrase]" {if $t.lt_translation == ''}style="border-color: red;"{/if}>{$t.lt_translation}</textarea>
				<input type="hidden" name="addForm[translations][{$t@index}][localeDefaultsId]" value="{$t.id}" />
				<input type="hidden" name="addForm[translations][{$t@index}][localeTranslationsId]" value="{$t.lt_id}" />
		</div>
		<div class="clear"> </div>
	{/foreach}
		<input type="hidden" name="addForm[languagesId]" value="{$languagesId}" />
		
		<div class="v_spacer"> </div>
		<div>
			<div class="right">
				<input type="submit" value="Submit" class="submit"/>
			</div>
		</div>
	
		
	</fieldset>
	</form>

</div>
{/strip}